<%@page import="com.uhaou.system.model.*" %>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/admin/commons/taglibs.jsp" %>
<html>
<head>
	<title><%=SysUser.TABLE_ALIAS%> 维护</title>
	<link type="text/css" rel="stylesheet" href="${ctx}/css/themes/default/easyui.css">
	<link type="text/css" rel="stylesheet" href="${ctx}/css/themes/icon.css">
	<script type="text/javascript" src="${ctx}/scripts/jquery-1.4.2.min.js"></script>
	<script type="text/javascript" src="${ctx}/scripts/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="${ctx}/scripts/locale/easyui-lang-zh_CN.js"></script>
	<script>
		$(function(){
			$('#queryForm').form({
				success:function(data){
				data = eval('('+data+')');
				$('#userDateGrid').datagrid("loadData",data);
				}
			});
		});

		$(function(){
			$('#userDateGrid').datagrid({
				title:'<%=SysUser.TABLE_ALIAS%>',
				iconCls:'icon-save',
				width:1000,
				height:500,
				nowrap: false,
				striped: true,
				collapsible:true,
				url: "${ctx}/system/SysUser/listAjax.do",                                                       
				remoteSort: false,
				idField:
					'id'
																																																																																				,
				columns:[[
					{field:'ck',checkbox:true}
							,{field:'id',title:'<%=SysUser.ALIAS_ID%>',width:120,sortable:true}
							,{field:'userName',title:'<%=SysUser.ALIAS_USER_NAME%>',width:120,sortable:true}
							,{field:'userPwd',title:'<%=SysUser.ALIAS_USER_PWD%>',width:120,sortable:true}
							,{field:'cardType',title:'<%=SysUser.ALIAS_CARD_TYPE%>',width:120,sortable:true}
							,{field:'cardId',title:'<%=SysUser.ALIAS_CARD_ID%>',width:120,sortable:true}
							,{field:'company',title:'<%=SysUser.ALIAS_COMPANY%>',width:120,sortable:true}
							,{field:'userNo',title:'<%=SysUser.ALIAS_USER_NO%>',width:120,sortable:true}
							,{field:'companyAdd',title:'<%=SysUser.ALIAS_COMPANY_ADD%>',width:120,sortable:true}
							,{field:'deptId',title:'<%=SysUser.ALIAS_DEPT_ID%>',width:120,sortable:true}
							,{field:'birthdayString',title:'<%=SysUser.ALIAS_BIRTHDAY%>',width:120,sortable:true}
							,{field:'email',title:'<%=SysUser.ALIAS_EMAIL%>',width:120,sortable:true}
							,{field:'phone',title:'<%=SysUser.ALIAS_PHONE%>',width:120,sortable:true}
							,{field:'mobile',title:'<%=SysUser.ALIAS_MOBILE%>',width:120,sortable:true}
							,{field:'familyAddr',title:'<%=SysUser.ALIAS_FAMILY_ADDR%>',width:120,sortable:true}
							,{field:'sex',title:'<%=SysUser.ALIAS_SEX%>',width:120,sortable:true}
							,{field:'fax',title:'<%=SysUser.ALIAS_FAX%>',width:120,sortable:true}
							,{field:'creator',title:'<%=SysUser.ALIAS_CREATOR%>',width:120,sortable:true}
							,{field:'createTimeString',title:'<%=SysUser.ALIAS_CREATE_TIME%>',width:120,sortable:true}
							,{field:'userStatus',title:'<%=SysUser.ALIAS_USER_STATUS%>',width:120,sortable:true}
							,{field:'deleted',title:'<%=SysUser.ALIAS_DELETED%>',width:120,sortable:true}
							,{field:'memo',title:'<%=SysUser.ALIAS_MEMO%>',width:120,sortable:true}
				]],
				pagination:true,
				rownumbers:true,
				toolbar:[
				{
					id:'btnview',
					text:'查看',
					iconCls:'icon-view',
					handler:function(){
						var selected = $('#userDateGrid').datagrid('getSelected');
						if (selected){
							location.href="${ctx}/system/SysUser/show.do?id="+selected.id;
						}
					}
				},'-',{
					id:'btnadd',
					text:'新增',
					iconCls:'icon-add',
					handler:function(){
							location.href="${ctx}/system/SysUser/create.do";
					}
				},{
					id:'btnedit',
					text:'修改',
					iconCls:'icon-edit',
					handler:function(){
						var selected = $('#userDateGrid').datagrid('getSelected');
						if (selected){
							location.href="${ctx}/system/SysUser/edit.do?id="
							+selected.id;
						}
					}
				}]
			});
			var p = $('#userDateGrid').datagrid('getPager');
			if (p){
				$(p).pagination({
					onBeforeRefresh:function(){
						alert('before refresh');
					}
				});
				$(p).pagination({
					onSelectPage:function(pageNumber,pageSize){
						$("input[name='pageNumber']").val(pageNumber);
						$("input[name='pageSize']").val(pageSize);
						$('#queryForm').submit();
					}
				});
			}
		});

		//以下这些方法放在这几是为了提供编写javascript参考用，可根据实际情况删除
		function resize(){
			$('#userDateGrid').datagrid('resize', {
				width:1100,
				height:400
			});
		}
		function getSelected(){
			var selected = $('#userDateGrid').datagrid('getSelected');
			if (selected){
				alert(selected.id);
			}
		}
		function getSelections(){
			var ids = [];
			var rows = $('#userDateGrid').datagrid('getSelections');
			for(var i=0;i<rows.length;i++){
				ids.push(rows[i].id);
			}
			alert(ids.join(':'));
		}
		function clearSelections(){
			$('#userDateGrid').datagrid('clearSelections');
		}
		function selectRow(){
			$('#userDateGrid').datagrid('selectRow',1); //行号从0开始
		}
		function selectRecord(){
			$('#userDateGrid').datagrid('selectRecord','1'); //'1'是id值
		}
		function unselectRow(){
			$('#userDateGrid').datagrid('unselectRow',1);//行号从0开始
		}
	</script>
</head>
<body>
<div style="width:1000px;padding:0px;">
<form id="queryForm" name="queryForm" action="<c:url value="/system/SysUser/listAjax.do"/>" method="post" style="display: inline;">
	<input type="hidden" id="pageNumber" name="pageNumber" value="1"/>
	<input type="hidden" id="pageSize" name="pageSize" value="10" />
	<div class="queryPanel">
		<fieldset>
			<legend>搜索</legend>
			<table>
				<tr>	
					<td class="tdLabel">用户名称</td>		
					<td>
						<input value="" id="userName" name="userName" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel">用户密码</td>		
					<td>
						<input value="" id="userPwd" name="userPwd" maxlength="255"  class=""/>
					</td>
					<td class="tdLabel">证件类型</td>		
					<td>
						<input value="" id="cardType" name="cardType" maxlength="2"  class=""/>
					</td>
					<td class="tdLabel">证件ID</td>		
					<td>
						<input value="" id="cardId" name="cardId" maxlength="20"  class=""/>
					</td>
				</tr>	
				<tr>	
					<td class="tdLabel">公司名称</td>		
					<td>
						<input value="" id="company" name="company" maxlength="200"  class=""/>
					</td>
					<td class="tdLabel">员工编号</td>		
					<td>
						<input value="" id="userNo" name="userNo" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel">公司地址</td>		
					<td>
						<input value="" id="companyAdd" name="companyAdd" maxlength="200"  class=""/>
					</td>
					<td class="tdLabel">部门ID</td>		
					<td>
						<input value="" id="deptId" name="deptId" maxlength="32"  class=""/>
					</td>
				</tr>	
				<tr>	
					<td class="tdLabel">生日</td>		
					<td>
						<input class="easyui-datebox" value="" id="birthdayBegin" name="birthdayBegin"   />
						<input class="easyui-datebox" value="" id="birthdayEnd" name="birthdayEnd"   />
					</td>
					<td class="tdLabel">EMAIL</td>		
					<td>
						<input value="" id="email" name="email" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel">电话</td>		
					<td>
						<input value="" id="phone" name="phone" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel">手机</td>		
					<td>
						<input value="" id="mobile" name="mobile" maxlength="13"  class=""/>
					</td>
				</tr>	
				<tr>	
					<td class="tdLabel">家庭地址</td>		
					<td>
						<input value="" id="familyAddr" name="familyAddr" maxlength="100"  class=""/>
					</td>
					<td class="tdLabel">性别</td>		
					<td>
						<input value="" id="sex" name="sex" maxlength="2"  class=""/>
					</td>
					<td class="tdLabel">传真</td>		
					<td>
						<input value="" id="fax" name="fax" maxlength="20"  class=""/>
					</td>
					<td class="tdLabel">创建者</td>		
					<td>
						<input value="" id="creator" name="creator" maxlength="32"  class=""/>
					</td>
				</tr>	
				<tr>	
					<td class="tdLabel">创建时间</td>		
					<td>
						<input class="easyui-datebox" value="" id="createTimeBegin" name="createTimeBegin"   />
						<input class="easyui-datebox" value="" id="createTimeEnd" name="createTimeEnd"   />
					</td>
					<!-- 
					<td class="tdLabel">用户状态</td>		
					<td>
						<input value="" id="userStatus" name="userStatus" maxlength="1"  class=""/>
					</td>
					<td class="tdLabel"><%=SysUser.ALIAS_DELETED%></td>		
					<td>
						<input value="" id="deleted" name="deleted" maxlength="1"  class=""/>
					</td>
					 -->
					<td class="tdLabel">备注</td>		
					<td>
						<input value="" id="memo" name="memo" maxlength="100"  class=""/>
					</td>
				</tr>	
			</table>
		</fieldset>
		<div class="handleControl">
			<input type="submit" class="stdButton" style="width:80px" value="查询" />
		<div>
	</div>
	<br></br>
		<div>
			<table id="userDateGrid"></table>
			 
		</div>
	</form>
</div>
</body>	
</html>


